<!DOCTYPE html>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<jsp:include page="/pad/common/commonCss.jsp"/>
<jsp:include page="/pad/common/commonJs.jsp"/>
<script  type="text/javascript" src="${basePath }pad/commonJs/jt_normal.js"></script>
 <link rel="stylesheet" type="text/css" href="${basePath}pad/commonCss/css/easyui.css">
<script  type="text/javascript" src="${basePath }pad/commonJs/jt_map.js"></script>
<link href='${basePath }pad/commonCss/css/fullcalendar-tuanti.css' rel='stylesheet' />
<link href='${basePath }pad/commonCss/css/fullcalendar.print-tuanti.css' rel='stylesheet' media='print' />
<link rel="stylesheet"   type="text/css" href="${basePath }pad/commonCss/css/baseDatePicker/ui.all.css" />
<script src="${basePath }pad/commonJs/tags/My97DatePicker/WdatePicker.js"></script>
<script src="${basePath}commonJs/jquery.imageScroller.js"></script> 
<script type="text/javascript">
var roomArray=null;
var fangArray=[];
var parReDateArray=[];
var fanglength =0;
var baseLocalPath='${basePath}';
var parStatus=new Array("未预付","自动取消","取消","待确认","已确认","进行中","完成","删除");
$(document).ready(function() {
	  getparRoomList();
	  roomArray= new   Array();    
	<c:forEach items="${listRoom}" var="parRoom" varStatus="status">
	  roomArray['${status.index}']='${parRoom.roomName}-';
	  </c:forEach>
	  fanglength =roomArray.length;
	var customerDate = parReDateArray[0];
	$("#selectDate").val(customerDate);
	$('#calendar').fullCalendar('destroy');
	$("#modiBy").val('${userIddq}');
	$("#fkBranId").val('${branIddq}');
	$("#locale").change(function() {
		$('#calendarInput').datepicker('option', $.extend({showMonthAfterYear: true},
			$.datepicker.regional[$(this).val()]));
	});
	$(".datepicker").datepicker({minDate: -3,maxDate: 3});
	renderCalendar(customerDate);
});
//查询 预约房间列表，在 日历控件 模式中显示  
function getparRoomList(){ 
	 var url ='${basePath }parreserve/findParReserveRooMList.shtml';
	$.ajax({
		   url: url,
		   type: 'POST',
		    data:$("#form1").serialize(),//序列化表单里所有的内容
		   async:false, 
		   error : function(XMLHttpRequest) {
			   ajaxError(XMLHttpRequest);
		   },
		   success:function(data){
				if (data != null) {
					var jsonarray ;
					fangArray=[];
					 for(var o in data){
						 if(o=="parResDateList"){
							 parReDateArray=data[o];
							 customerDate=parReDateArray[0];
							 $("#selectDate").val(customerDate);
						 }
						 if(o=="gblparResRoomMap"){
							 jsonarray=data[o];
							// var obj = str.parseJSON(); start: '2014-06-12T10:00:00',
					//end: '2014-06-12T12:00:00'
							 for (var k = 0; k < jsonarray.length; k++){
								 fangArray.push();
								 var jsonobj = jsonarray[k];
								 var statusInt=jsonobj["resStatus"];
								 var parStatusName=parStatus[statusInt-1];
								 var subject=jsonobj["subject"];
								 var conName=jsonobj["conName"];
								 if(conName==null){
									 conName ="";
								 }
								 if(subject==null){
									 subject ="";
								 }
								 if(subject.length>12){
									 subject =subject.substring(0,12)+"...";
								 }
								 if(conName.length>12){
									 conName =conName.substring(0,12)+"...";
								 }
								 var fangid=jsonobj["roomName"]+"-"+jsonobj["roomId"]+"@"+jsonobj["lockFlag"];
								 var partitle=jsonobj["roomName"]+"-"+parStatusName+"\n"+subject+"\n"+conName+" "+jsonobj["conMobile"];
								 var parStart=jsonobj["presDay"]+"T"+jsonobj["resTimeS"];
								 var parEnd=jsonobj["presDay"]+"T"+jsonobj["resTimeE"];
								 var grpFlag =jsonobj["grpFlag"]; 
								 var pkParresId =jsonobj["pkParresId"];
								 var  detailUrl="";
								 //var  detailUrl='${basePath }parreserve/editReservationPage.shtml?pkParresId='+pkParresId+'&grpFlag='+grpFlag;
								 var testJson = { "id": fangid, "title":partitle,"start":parStart,"end":parEnd,"url":detailUrl};
								 fangArray.push(testJson);
								  
							 }
						 }
					 }
				}else{
					 alertError('加载预约房间失败！');
				}
		   }
		  });
}
//点击时间获取预约信息
function  getInfo(dp){
	if(checkIsNull(dp.cal.getNewDateStr())){
		return;
	}else{
		$('#calendar').fullCalendar('destroy');
		renderCalendar(dp.cal.getNewDateStr());
	}
}

var basePath = "${basePath}";
</script>
<script type="text/javascript" src='${basePath }pad/commonJs/lib/moment.min.js'></script>
<script type="text/javascript" src='${basePath }pad/commonJs/lib/jquery-ui.custom.min.js'></script>
<script type="text/javascript" src='${basePath }pad/commonJs/fullcalendar_tuanti.js'></script>
<script type="text/javascript" src='${basePath }pad/commonJs/lang-all.js'></script>
<script type="text/javascript" src="${basePath }pad/commonJs/ui/ui.core.js"></script>
<script type="text/javascript" src="${basePath}pad/commonJs/ui/ui.datepicker.js"></script>
<script type="text/javascript" src="${basePath}pad/commonJs/ui/ui.datepicker-zh-CN.js"></script>
<script type="text/javascript" src="${basePath}pad/commonJs/jquery.form.min.js"></script>
<script type="text/javascript" src="${basePath}pad/commonJs/order_reservationSelect.js"></script>
<script type="text/javascript" src="${basePath }pad/commonJs/calendar.js"></script>
<title>会籍预约</title>
</head>
<body class="bg">
 <form action="" id="form1">
   <input type="hidden" name="resStatus" id="resStatus" value="1456" > <!-- 新增 预约 的 日期控件 只显示 状态 为 1，4，5，6的 数据 -->
 </form>
<div class="i_index">
    <div class="i_index_l fl">
    	<h1><a href="view/ipad_logout/logout.html"><i class="icon iconfont">&#xe60f;</i><br>Lisa</a></h1>
       <ul>
        	<li><a href="../../index.html"><i class="icon iconfont">&#xe600;</i><br>首页</a></li>
            <li><a href="${basePath}filemanagement/findVipInfo.shtml"><i class="icon iconfont">&#xe603;</i><br>会籍</a></li>
            <li class="i_index_l_hover"><a href="${basePath}parreserve/reservationPage.shtml"><i class="icon iconfont">&#xe604;</i><br>预约</a></li>
            <li><a href="../ipad_consume/consume.html"><i class="icon iconfont">&#xe602;</i><br>消费管理</a></li>
            <li><a href="../ipad_report/report_management.html"><i class="icon iconfont">&#xe601;</i><br>报表</a></li>
        </ul>
    </div>
    <div class="i_index_r fl oh">
        <div class="clear"></div>
        <!-- 内容 -->
        
        <ul id="tab_conbox_c">
        	<li class="p20">
				<h2>选择日期：<input type="text" onFocus="WdatePicker({onpicking:function(dp){getInfo(dp);}});" class="Wdate iput_t w150" readonly="readonly"  id="selectDate" name="selectDate" title=""></h2>
            	<div id='calendar' class="data_l mt10 riqi"></div>
            </li>
         
        </ul>
        <!-- 内容 -->
    </div>
</div>
</body>
</html>
